package scuts.core;

using scuts.core.extensions.Options;
import scuts.core.types.Option;

class GetOrElseErrorOption 
{
  public static function getOrElseError <T>(o:Option<T>, errorMsg:Dynamic):T 
  {
    return if (o.isSome()) o.value() else throw errorMsg;
  }
  
}